﻿using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Linguist.Acoustic
{
    /// <summary>
    /// Represents a transition to single state in an HMM
    ///
    //// All probabilities are maintained in linear base
    /// </summary>
    public class HMMStateArc : IHMMStateArc
    {
        private IHMMState hmmState;
        private float probability;


        /**
        /// Constructs an HMMStateArc
         *
        /// @param hmmState    destination state for this arc
        /// @param probability the probability for this transition
         */
        public HMMStateArc(IHMMState hmmState, float probability) {
            this.hmmState = hmmState;
            this.probability = probability;
        }


        /**
        /// Gets the HMM associated with this state
         *
        /// @return the HMM
         */
        public IHMMState getHMMState() {
            return hmmState;
        }


        /**
        /// Gets log transition probability
         *
        /// @return the probability in the LogMath log domain
         */
        public float getLogProbability() {
            return probability;
        }


        /** returns a string representation of the arc */
        override
        public String ToString() {
            return "HSA " + hmmState + " prob " + probability;
        }
    }
}
